package com.hainatong.jcmvvmbase.login.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.hainatong.jcmvvmbase.R;
import com.hainatong.jcmvvmbase.databinding.ItemImgViewBinding;
import com.hainatong.jcmvvmbase.login.entity.GirlImgBean;
import org.jetbrains.annotations.NotNull;

public class ImageBindingAdapter extends BaseQuickAdapter<GirlImgBean, BaseDataBindingHolder<ItemImgViewBinding>>
{

    public ImageBindingAdapter()
    {
        super(R.layout.item_img_view);
    }

    @Override
    protected void convert(@NotNull BaseDataBindingHolder<ItemImgViewBinding> dataBindingHolder, GirlImgBean girlImgBean)
    {
        ItemImgViewBinding viewBinding = dataBindingHolder.getDataBinding();

        if( viewBinding != null )
        {
            viewBinding.setGirlImg( girlImgBean );
            viewBinding.executePendingBindings();
        }
    }
}
